package com.zjdiepu.www.commpent.mapper.dz;

import javax.annotation.Resource;

import org.springframework.data.redis.connection.RedisConnection;
import org.springframework.stereotype.Component;

import com.zjdiepu.www.base.core.BaseMapper;
import com.zjdiepu.www.base.enums.type.DataDicType;
import com.zjdiepu.www.commpent.RedisObjectClient;
import com.zjdiepu.www.ibiz.third.IJuheCityService;
import com.zjdiepu.www.ibiz.third.IJuheProvinceService;
import com.zjdiepu.www.model.base.dto.SimpleDataDictionary;
import com.zjdiepu.www.model.dz.dto.DzPickCar;

/**
 * 提车转换
 * 类描述:提车转换 <br/>     
 * 项目名称:diepu-parent-biz <br/> 
 * 类名称:DzPickCarVoMapper <br/>     
 * 创建人:xiongxiaotun <br/> 
 * 创建时间:2017年11月27日 上午11:14:49  <br/>   
 * 修改人:xiongxiaotun <br/> 
 * 修改时间: 2017年11月27日 上午11:14:49   <br/>  
 * 修改备注:   <br/> 
 * @version V1.0   <br/>
 */
@Component
public class DzPickCarVoMapper extends BaseMapper<DzPickCar> {
	@Resource
	private IJuheProvinceService juheProvinceService;
	@Resource
	private IJuheCityService juheCityService;
	@Resource
	private RedisObjectClient redisObjectClient;
	
	@Override
	public void mapper(RedisConnection redisConnection, DzPickCar m) {
		if(null == m) {
			return;
		}
		
		String categoryCar = m.getCategoryCar();
		SimpleDataDictionary simpleDataDictionary6 = redisObjectClient.hGet(redisConnection, SimpleDataDictionary.class.getSimpleName(),categoryCar, DataDicType.CAR_CATEGORY.getCode());
		m.setCategoryCarDisplay(simpleDataDictionary6 == null ? "" : simpleDataDictionary6.getName());
		
		String colorCar = m.getColorCar();
		SimpleDataDictionary simpleDataDictionary7 = redisObjectClient.hGet(redisConnection, SimpleDataDictionary.class.getSimpleName(),colorCar, DataDicType.CAR_COLOR.getCode());
		m.setColorCarDisplay(simpleDataDictionary7 == null ? "" : simpleDataDictionary7.getName());
		
	}

}
